from core.basehandler import BaseHandler
from core.room import Room
from core.action import Action
from core.support import set_cutscene

class wall(Room):
    def __init__(self, room_id):
        Room.__init__(self, room_id)    # do basic initialization for every room
        
        # build list of actions
        self.add_action(dancefloor)
        self.add_action(getTossed)
    
    # return description of room.
    def get_description(self):
        return "This corner is Sad and Lonely. From here you can scope out the scene on the Dance Floor, where people are smiling beneath the bright lights."
    
    # return image of room
    def get_image(self):
        return 'wall.jpg'


class WallHandler(BaseHandler):
    
    # return class to use to create a new instance of this room
    def get_room_class(self):
        return wall

# define actions for this room

class dancefloor(Action):
    def __init__(self):
        Action.__init__(self, "dancefloor")    # do basic initialization for every action
    
    # return description of action (used in label on webpage)
    def get_description(self):
        return "Return to the Dance Floor"
    
    # return id of room to enter when action is complete
    def get_destination(self):
        return 'dancefloor'
    
    # return http method to use when user clicks on this action
    # use "get" if just moving to another room.  if changing something
    # like the state of an inventory item or room then use "post"
    def get_method(self):
        return "get"
    
class getTossed(Action):
    def __init__(self):
        Action.__init__(self, "tossed")    # do basic initialization for every action
    
    # return description of action (used in label on webpage)
    def get_description(self):
        return "Hang out here"
    
    # return id of room to enter when action is complete
    def get_destination(self):
        return 'wall'
    
    # set cutscene for when arrive in outside
    def do_action(self,game,room,request):
        game.social -= 1
        set_cutscene("Wow. This corner really is Sad AND Lonely. You lose an interaction point just for hanging out here.")
        self.usable = False
        return
    
    # return http method to use when user clicks on this action
    # use "get" if just moving to another room.  if changing something
    # like the state of an inventory item or room then use "post"
    def get_method(self):
        return "get"